package com.njwb.day08;

public class TestInteger {
    public static void main(String[] args) {
        //int最大最小范围
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);

        Integer it=new Integer(10);
        System.out.println(it+20);
        it=new Integer("20");
        System.out.println(it+100);
        byte b=it.byteValue();//(byte)int

        int i=10;
        //int-->String(int-->Integer-->String)
        Integer it2=new Integer(i);
        String str=it2.toString();
        System.out.println(str);
        System.out.println(str instanceof String);
        str=Integer.toString(i);
        System.out.println(str);
        System.out.println(str instanceof String);

        str=i+"";
        //String-->int(String-->Integer-->int)
        str="100";
        Integer it3=new Integer(str);
        int i2=it3.intValue();
        System.out.println(i2);

        //自动装箱
        int i3=10;
        //int-->Integer
        Integer it4=i3;
        it4=100;
        //自动拆箱
        Integer it5=new Integer(100);
        i3=it5;

    }
}
